package com.zr.lads.pojo;
// Generated 2016-10-26 11:45:42 by Hibernate Tools 4.0.0.Final

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * User generated by hbm2java
 */
@Entity
@Table(name = "user", catalog = "lads")
public class User implements java.io.Serializable {

	private Integer UId;
	private Role role;
	private String UAccount;
	private String UPassword;
	private String UName;
	private String USex;
	private String UPhone;
	private String UEmail;
	private String UAddress;
	private String UEntrydate;
	private Set<Uorder> uorders = new HashSet<Uorder>(0);

	public User() {
	}

	public User(Role role, String UAccount, String UPassword, String UName, String USex, String UPhone, String UEmail,
			String UAddress, String UEntrydate, Set uorders) {
		this.role = role;
		this.UAccount = UAccount;
		this.UPassword = UPassword;
		this.UName = UName;
		this.USex = USex;
		this.UPhone = UPhone;
		this.UEmail = UEmail;
		this.UAddress = UAddress;
		this.UEntrydate = UEntrydate;
		this.uorders = uorders;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "u_id", unique = true, nullable = false)
	public Integer getUId() {
		return this.UId;
	}

	public void setUId(Integer UId) {
		this.UId = UId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "role_id")
	public Role getRole() {
		return this.role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	@Column(name = "u_account", length = 16)
	public String getUAccount() {
		return this.UAccount;
	}

	public void setUAccount(String UAccount) {
		this.UAccount = UAccount;
	}

	@Column(name = "u_password", length = 16)
	public String getUPassword() {
		return this.UPassword;
	}

	public void setUPassword(String UPassword) {
		this.UPassword = UPassword;
	}

	@Column(name = "u_name", length = 32)
	public String getUName() {
		return this.UName;
	}

	public void setUName(String UName) {
		this.UName = UName;
	}

	@Column(name = "u_sex", length = 8)
	public String getUSex() {
		return this.USex;
	}

	public void setUSex(String USex) {
		this.USex = USex;
	}

	@Column(name = "u_phone", length = 16)
	public String getUPhone() {
		return this.UPhone;
	}

	public void setUPhone(String UPhone) {
		this.UPhone = UPhone;
	}

	@Column(name = "u_email", length = 32)
	public String getUEmail() {
		return this.UEmail;
	}

	public void setUEmail(String UEmail) {
		this.UEmail = UEmail;
	}

	@Column(name = "u_address")
	public String getUAddress() {
		return this.UAddress;
	}

	public void setUAddress(String UAddress) {
		this.UAddress = UAddress;
	}

	@Column(name = "u_entrydate", length = 16)
	public String getUEntrydate() {
		return this.UEntrydate;
	}

	public void setUEntrydate(String UEntrydate) {
		this.UEntrydate = UEntrydate;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Uorder> getUorders() {
		return uorders;
	}

	public void setUorders(Set<Uorder> uorders) {
		this.uorders = uorders;
	}

}
